#region Using Directives

using System;
using System.IO;
using System.Globalization;

using Microsoft.Practices.ComponentModel;
using Microsoft.Practices.RecipeFramework;
using Microsoft.Practices.RecipeFramework.Services;
using Microsoft.Practices.RecipeFramework.Library;

using EnvDTE;

#endregion

namespace EEst.SoftwareFactory.Actions
{
    class CopyVCPPFilesAction : Action
    {
        #region Input Properties

        [Input]
        public string SourcePath
        {
            get { return sourcePath; }
            set { sourcePath = value; }
        } string sourcePath;

        #endregion

        #region Output Properties

        [Output]
        public string Result
        {
            get { return result; }
            set { result = value; }
        } string result;

        #endregion

        #region IAction Members

        public override void Execute()
        {
            GuidancePackage gPackage = (GuidancePackage)GetService(typeof(GuidancePackage));
            string basePath = gPackage.BasePath;
            string srcPath = string.Format(CultureInfo.InvariantCulture, @"{0}\Templates\Solutions\Projects\{1}", basePath, sourcePath);
            DTE vs = (DTE)GetService(typeof(DTE));


            Project target = DteHelper.GetSelectedProject(vs);
            string targetProjFile = target.FileName;

            string targetPath = Path.GetDirectoryName(targetProjFile);
            CopyContentsFromGP2Prj util = new CopyContentsFromGP2Prj();
 //           util.CopyContents(srcPath, "*.h;*.cpp", targetPath);

            result = "OK";
        }

        public override void Undo()
        {
            throw new Exception("The method or operation is not implemented.");
        }

        #endregion
    }
}
